<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="baiduAudio"></div>
    <script type="text/javascript">
        var zhText = "你好";
        zhText = encodeURI(zhText);
        document.write("<audio autoplay=\"autoplay\">");

        document.write("<source src=\"http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&per=4&spd=5&text=" + zhText + "\" type=\"audio/mpeg\">");

        document.write("<embed height=\"0\" width=\"0\" src=\"http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&per=4&spd=5&text=" + zhText + "\">");

        document.write("</audio>");
    </script>
</body>

</html>
